import { userInfoService } from './../api/user';
import type { AxiosError } from 'axios';

export default function(){
  async function getUserInfo() {
    try{
      let result = await userInfoService()
      if(result.data){
        return result.data
      }
    }catch(error){
      const err = <AxiosError>error
      console.log(err.message);
    }
  }
  return {
    getUserInfo
  }
}